﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
</head>
<body>
    <script src="../alloy_flow.js"></script>
    <script>
        var af = new AlloyFlow({
            workflow: [
                   function () {
					   var self = this;
                       setTimeout(function () {
                           console.log(11);
                           self.next(22);
                       },2000)
                   },
                   function (msg) {
                       console.log(msg);
                       this.callback(33,44);
                   },
                   function (msg,msg2) {
                       console.log(msg+"__"+msg2);
                       console.log(44);
                   }

            ],
            onStart: function () {
            },
            onProgress: function () { },
            onEnd: function () { console.log("end") },
        }).start()

        new AlloyFlow({
            workflow: [
                 {
                     work: function () {
                         console.log(1);
                     },
                     start: 10
                 },
                {
                    work: function () {
                        console.log(2);
                    },
                    start: [0, 50, 100, 150, 200]
                },
                {
                    work: function () {
                        console.log(5);
                    },
                    start: [0, 50, 100, 150, 200]
                },
                {
                    work: function () {
                        console.log(3);
                    },
                    start: 100
                }
            ]
        }).start();
    </script>
</body>
</html>
